
# -*- coding: utf-8 -*-

from peewee import *

USER_LOGIN_LIST = [
	{
		"id": 1,
		"username": "admin",
		"password": "mandrake2505",
		"admin": True
	},{
		"id": 2,
		"username": "guest",
		"password": "leduca123",
		"admin": False
	}
]

USER_WEBSERVICE_LIST = {}

IMAGE_DIR = "data/images"
RAW_IMAGE_DIR = "data/raw_images"

DATABASE = SqliteDatabase("data/images.db")
DATABASE_LOGS = SqliteDatabase("data/logs.db")
TRAINING_MODEL_FILENAME = "data/model.yaml"
OPENCV_CASCADE_CLASSIFIER = "data/haarcascade_frontalface_default.xml"
USERS_WEBSERVICE_URL = "http://200.9.4.106/personal/webservice.php"

PHOTONUMBER = 0

STATE_TRAINING_MODEL = False

def isAdmin(userid):
	retVal = False
	try:
		userid = int(userid)
		for user in USER_LOGIN_LIST:
			if int(user["id"]) == userid and user["admin"] is True:
				retVal = True
	except:
		pass
	return retVal
